<template>
  <f-page-layout title="表单应用" :actions="actions" class="wrapper">
    <div style="overflow-y: auto; height: 100%">
      <f-dy-entry
        style="width: 210mm; margin: 0 auto; height: auto"
        ref="form"
        :query="query"
        :params="query"></f-dy-entry>
    </div>
  </f-page-layout>
</template>
<script setup lang="ts">
import { http } from 'fok-ui';
import { ref } from 'vue';
import { reactive } from 'vue';
import { printScoreTable } from '../../packages';

const form = ref();
const query = reactive({
  docId: '1912770298204971008',
  visitId: '1909067581029916673',
  visitType: '21'
});
const create = () => {
  http
    .post('/clinical/emr/document/create', {
      templateId: '1912755397830995968',
      visitId: '1909067581029916673',
      visitType: '21'
    })
    .then((res) => {});
};
const actions = ref([
  {
    label: '创建文书',
    type: 'primary',
    click: () => create()
  },
  {
    label: '保存',
    type: 'primary',
    click: () => {
      form.value.submit();
      console.log('保存');
    }
  },
  {
    label: '打印',
    click: () => {
      form.value.print();
    }
  }
]);
</script>

<style lang="scss">
.wrapper {
  height: 100vh;
}
</style>
